package w2;

import java.util.Scanner;

public class Lt3 {
	static boolean isLeapYear(int year) {
		// return year % 400 == 0 || (year % 4 == 0 && year % 100 !=0);
		if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
			return true;
		} else {
			return false;
		}
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入年，月：");
		int year = in.nextInt();
		int month = in.nextInt();
		if (isLeapYear(year)) {
			System.out.println(year + "是闰年");
		} else {
			System.out.println(year + "是平年");
		}
		switch (month) {
		case 1:
		case 3:
		case 5:
		case 7:
		case 8:
		case 10:
		case 12:
			System.out.println(month + "月有31天");
			break;
		case 2:
			System.out.println("2月有" + (isLeapYear(year) ? 29 : 28) + "天");
			break;
		default:
			System.out.println(month + "月有30天");
		}
	}

}
